package com.y.architecture.location;

import android.support.annotation.NonNull;

import com.amap.api.location.AMapLocation;

import rx.Subscriber;

/**
 * Created by youjingjing on 2017/11/22.
 */

public abstract class LocationSubscriber extends Subscriber<AMapLocation> {
    @Override
    public void onCompleted() {

    }

    @Override
    public void onError(Throwable e) {

    }

    @Override
    public void onNext(AMapLocation aMapLocation) {
        if (LocationUtil.isLocationResultEffective(aMapLocation)) {
            onLocatedSuccess(aMapLocation);
        } else {
            onLocatedFail(aMapLocation);
        }
    }
    public abstract void onLocatedSuccess(@NonNull AMapLocation bdLocation);
    public abstract void onLocatedFail(AMapLocation bdLocation);

}
